package com.smedi.ismedi.personnel.api.dto.response;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * @Author: xulinjun
 * @Date: 2021-6-8 13:28
 */
@Data
public class PersonSimpleResponse implements Serializable {
    @ApiModelProperty(value = "人员id")
    private Long personId;

    @ApiModelProperty(value = "姓名")
    private String lastName;

    @ApiModelProperty(value = "性别")
    private String gender;

    @ApiModelProperty(value = "性别含义")
    private String genderMeaning;

    @ApiModelProperty(value = "照片")
    private String imageUUID;

    @ApiModelProperty("登录名")
    private String userName;

    @ApiModelProperty("手机号")
    private String mobile;

    @ApiModelProperty(value = "邮箱")
    private String email;

    @ApiModelProperty(value = "工号")
    private String employeeNum;

    @ApiModelProperty(value = "人员类型")
    private String personType;

    @ApiModelProperty(value = "人员类型含义")
    private String personTypeMeaning;

    @ApiModelProperty(value = "状态")
    private String status;

    @ApiModelProperty(value = "状态含义")
    private String statusMeaning;

    @ApiModelProperty(value = "是否企业人员")
    private boolean internal;

    @ApiModelProperty(value = "企业分配")
    private List<InternalAssignmentResponse> internalAssignments = new ArrayList<>();

    public String getGender() {
        if (this.gender.equals("M") || this.gender.equals("MALE")) {
            return "MALE";
        } else {
            return "FEMALE";
        }
    }

    public String getGenderMeaning() {
        if (this.gender.equals("M") || this.gender.equals("MALE")) {
            return "男";
        } else {
            return "女";
        }
    }
}
